<!-- Main content -->
<section class="content">
	<div class="row">
		<!-- right column -->
		<div class="col-md-12">
		
			<!-- general form elements disabled -->
			<div class="box box-alegro">
			
				<div class="box-body">
					<form role="form" method="post" action="<?php echo base_url('usuario/adicionar'); ?>">
						<?php 
							if (validation_errors()) {
								$html = '<div class="alert alert-danger alert-dismissable">
											<i class="fa fa-warning"></i>' . validation_errors() . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('adicionarok')){
								$html = '<div class="alert alert-success alert-dismissable">
											<i class="fa fa-check"></i>' . $this->session->flashdata('adicionarok') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('adicionarerro')){
								$html = '<div class="alert alert-danger alert-dismissable">
											<i class="fa fa-warning"></i>' . $this->session->flashdata('adicionarerro') . '</div>';
								echo $html;
							}
						?>
						<!-- text input -->
						<div class="row">
							<div class="form-group col-md-3">
								<label>Código Representante Singem</label> 
								<?php 
								echo form_input(array('name'=>'usu_codigo_singem', 'maxlength' => '2', 'class'=>'form-control', 'placeholder'=>'Código do Representante'),set_value('usu_codigo_singem'),'autofocus');
								?>
							</div>
							<div class="form-group col-md-5">
								<label>Nome</label> 
								<?php 
								echo form_input(array('name'=>'usu_nome', 'class'=>'form-control', 'placeholder'=>'Nome do Representante'),set_value('usu_nome'));
								?>
							</div>
							<div class="form-group col-md-4">
								<label>E-mail</label> 
								<?php 
								echo form_input(array('name'=>'usu_email', 'class'=>'form-control', 'placeholder'=>'E-mail'),set_value('usu_email'));
								?>
							</div>
						</div>
						
						<div class="row">
							<div class="form-group col-md-3">
								<label>Tipo de Cliente</label> 
								<?php 
								//$tipo = array('1'=>'Vendedor', '2'=>'Comercial', '3'=>'Financeiro');
								$tipo_usuario = json_decode($tipo_usuario);
								$tipo = array();
								foreach( $tipo_usuario as $item){
									$tipo[$item->tip_codigo_tipo_usuario] = $item->tpusu_nome;
								}
								
								echo form_dropdown('tip_codigo_tipo_usuario',$tipo, set_value('tip_codigo_tipo_usuario'), 'class="form-control"');
								?>
							</div>
							<div class="form-group col-md-3">
								<label>Status</label>
								<?php 
								$status = array('1'=>'Ativo', '2'=>'Inativo');
								echo form_dropdown('usu_status', $status, set_value('usu_status'), 'class="form-control"');
								?> 
							</div>
							<div class="form-group col-md-3">
								<label>Grupo</label>
								<?php 
								$grupo = array('0015'=>'Alegro', '0016'=>'Giardinni');
								echo form_dropdown('usu_grupo', $grupo, set_value('usu_grupo'), 'class="form-control"');
								?> 
							</div>
						</div>
						<div class="row">
							<div class="form-group col-md-3">
								<label>Senha</label> 
								<?php 
								echo form_password(array('name'=>'usu_senha', 'class'=>'form-control', 'placeholder'=>'Senha'),set_value('usu_senha'));
								//echo form_input(array('name'=>'usu_senha', 'class'=>'form-control', 'placeholder'=>'Senha'),set_value('usu_senha'));
								?>
							</div>
							<div class="form-group col-md-3">
								<label>Confirme a Senha</label> 
								<?php 
								echo form_password(array('name'=>'usu_confirma_senha', 'class'=>'form-control', 'placeholder'=>'Confirme a Senha'),set_value('usu_confirma_senha'));
								//echo form_input(array('name'=>'usu_confirma_senha', 'class'=>'form-control', 'placeholder'=>'Confirma Senha'),set_value('usu_confirma_senha'));
								?>
							</div>
						</div>

						<button type="submit" class="btn btnAdminAlegro">{botaopadrao}</button>
						<button type="reset" class="btn btnAdminAlegro">{botaolimpar}</button>
					</form>
				</div>
				<!-- /.box-body -->
				
			</div>
			<!-- /.box -->
		</div>
		<!--/.col (right) -->
	</div>
	<!-- /.row -->
</section>
<!-- /.content -->
